import 'package:flutter/material.dart';

class LoadingOverlayTheme extends ThemeExtension<LoadingOverlayTheme> {
  final Color backgroundColor;
  final Color loadingColor;

  LoadingOverlayTheme({
    required this.backgroundColor,
    required this.loadingColor,
  });

  @override
  LoadingOverlayTheme copyWith({
    Color? backgroundColor,
    Color? loadingColor
  }) {
    return LoadingOverlayTheme(
      backgroundColor: backgroundColor ?? this.backgroundColor,
       loadingColor: loadingColor ?? this.loadingColor,
    );
  }

  @override
  LoadingOverlayTheme lerp(
      ThemeExtension<LoadingOverlayTheme>? other, double t) {
    if (other is! LoadingOverlayTheme) return this;

    return LoadingOverlayTheme(
      backgroundColor: Color.lerp(backgroundColor, other.backgroundColor, t)!,
      loadingColor: Color.lerp(loadingColor, other.loadingColor, t)!,
    );
  }
}
